<div class="pageContent">
	
	<form method="post" action="/index.php?act=transporttmp&st=transporttmp_edit" class="pageForm required-validate" onsubmit="return validateCallback(this, dialogAjaxDone)">
		<input type="hidden" name="id" value="{$transporttmp.transport_tmp_id}">
		<div class="pageFormContent" layoutH="58">

			<div class="unit">
				<label>模板名称：</label>
				<input name="tmp_name" type="text" size="30" value="{$transporttmp.tmp_name}" class="required" errormsg="请输入模板名称"/>
			</div>
			<div class="unit">
				<label>模板类型：</label>
				<select class="required combox" name="tmp_type" errormsg="请选择模板类型">
					<option value="">请选择模板类型</option>
					<option value="1" {if $transporttmp.tmp_type eq 1}selected{/if}>汽运模板</option>
					<option value="2" {if $transporttmp.tmp_type eq 2}selected{/if}>火运模板</option>
					<option value="3" {if $transporttmp.tmp_type eq 3}selected{/if}>海运模板</option>
					<option value="4" {if $transporttmp.tmp_type eq 4}selected{/if}>水汽联运</option>
				</select>
			</div>
			<div class="unit">
				<label>吨位区间：</label>
				<div><center>
					<table class="list nowrap itemDetail" addButton="添加吨位区间" width="70%">
						<thead>
							<tr>
								<th type="text" name="min[#index#]" size="10" fieldClass="number required sectionmin" defaultVal="0" fieldAttrs="{readonly:'readonly'}">最小值</th>
								<th type="text" name="max[#index#]" size="10" fieldClass="number required sectionmax">最大值</th>
								<th type="del" width="60">操作</th>
							</tr>
						</thead>
						<tbody>
							{foreach from=$transporttmp.section key=key item=item}
							<tr class="unitBox"><td><input type="text" name="min[{$key}]" value="{$item.min}" size="10" class="number required textInput valid sectionmin" readonly></td><td><input type="text" name="max[{$key}]" value="{$item.max}" size="10" class="number required textInput sectionmax"></td><td><a href="javascript:void(0)" class="btnDel ">删除</a></td></tr>
							{/foreach}
						</tbody>
					</table></center>
				</div>
			</div>
		</div>
		
		<div class="formBar">
			<ul>
				<li><div class="buttonActive"><div class="buttonContent"><button type="submit">提交</button></div></div></li>
				<li><div class="button"><div class="buttonContent"><button type="button" class="close">取消</button></div></div></li>
			</ul>
		</div>

	</form>

</div>
<script type="text/javascript">
$(function(){
	$(".sectionmax").die("keyup");
	$(".sectionmax").live("keyup", function(){
		var val = $(this).val();
		val = parseFloat(val, 10);
		var index = $(this).parents("tr").index();
		if(isNaN(val)){
			$(".sectionmin:eq("+(index+1)+")").val(0);
		}else{
			$(".sectionmin:eq("+(index+1)+")").val(val);
		}
	});
});
</script>
